const hiddenProperties = ['foo', 'bar'];
const targetObject = {
    foo: 1,
    bar: 2,
    baz: 3,
};

const proxy = new Proxy(targetObject, {
    get(target, property, receiver) {
        if (hiddenProperties.includes(property)) {
            return undefined;
        } else {
            return Reflect.get(...arguments);
        };
    },


    has(target, property, receiver) {
        if (hiddenProperties.includes(property)) {
            return false;
        } else {
            return Reflect.has(...arguments);
        };
    },
});


// get
console.log(proxy.foo);   // undefined
console.log(proxy.baz);  // 3

// has
console.log('foo' in proxy);   // false
console.log('baz' in proxy); // true